package com.wa.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 系统类型枚举
 * @Author Dawn
 * @Date 2021/10/19 10:02
 */
public enum LogPlatformEnum {

    NONE(0, "none", "不指定系统类型"),
    USER(10, "user system", "用户系统"),
    GOODS(20, "goods system", "商品系统"),
    ;

    private int statusCode;
    private String statusMsgEn;
    private String statusMsgCn;
    private static final Map<Integer, LogPlatformEnum> lookup = new HashMap<>();

    static {
        for (LogPlatformEnum ase : LogPlatformEnum.values()) {
            lookup.put(ase.getStatusCode(), ase);
        }
    }

    LogPlatformEnum(int statusCode, String statusMsgEn, String statusMsgCn) {
        this.statusCode = statusCode;
        this.statusMsgEn = statusMsgEn;
        this.statusMsgCn = statusMsgCn;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getStatusMsgEn() {
        return statusMsgEn;
    }

    public String getStatusMsgCn() {
        return statusMsgCn;
    }

    public static LogPlatformEnum get(Integer statusCode) {
        return lookup.get(statusCode);
    }
}
